package cn.usain.controller;

import cn.usian.client.EmployeeClient;
import cn.usian.common.R;
import cn.usian.entity.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/employee")
public class EmployeeController {
    @Autowired
   private EmployeeClient employeeClient;
    @GetMapping("/page")
    public R findPage(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int pageSize,@RequestParam(required = false) String name){
        return employeeClient.findPage(page,pageSize,name);
    }
    @PostMapping
    public R save(@RequestBody Employee employee){
        return employeeClient.save(employee);
    }
}
